import { DisposeView } from "../../../mvc/core/DisposeView";
import { LayerManager } from "../../manager/LayerManager";
import { Cache } from "../../cache/Cache";
import { EEntityFightMode } from "../../../../Message/Public/EEntityFightMode";
import { Language } from "../../../../extend/language/Language";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { SecTimerView } from "../common/SecTimerView";
import { GTextFormat } from "../../../common/GTextFormat";
import { FontUtil } from "../../../common/font/FontUtil";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { FilterConst } from "../../../component/gconst/FilterConst";
import { GTextFiled } from "../../../../com/mui/controls/GTextFiled";
type int = number;
//class AttachedSoulBattlefieldInfoView
    
    export  class AttachedSoulBattlefieldInfoView extends DisposeView
    {
        constructor()
        {
            super();
            this.layer = LayerManager.uiLayer;
            this.mouseEnabled = false;
            return;
        }

        /* internal  */onStarMove(arg1: Object /* flash.events.MouseEvent */): void
        {
            this.startDrag();
            return;
        }

        /* internal  */onStopMove(arg1: Object /* flash.events.MouseEvent */): void
        {
            this.stopDrag();
            return;
        }

        public setIntegral(arg1: int, arg2: int): void
        {
            if (Cache.instance.role.entityInfo.fightModel != EEntityFightMode._EEntityFightModeObseve) 
            {
                this._infoTxt.htmlText = Language.getStringByParam(28615, arg1, arg2);
            }
            else 
            {
                this._infoTxt.htmlText = Language.getStringByParam(28636, arg1, arg2);
            }
            return;
        }

        public set tfLeftTime(arg1: int)
        {
            this._tfLeftTime.setLeftTime(arg1);
            return;
        }

        public /* override */ show(arg1: int=0, arg2: int=0): void
        {
            super.show(arg1, arg2);
            Dispatcher.dispatchEvent(new DataEvent(EventName.TaskTrackShowOrHide, false));
            return;
        }

        protected /* override */ createDisposedChildrenImpl(): void
        {
            super.createDisposedChildrenImpl();
            pushUIToDisposeVec(ObjCreate.createBg(0, 0, 300, 90, this, ImagesConst.ToolTipBg));
            pushUIToDisposeVec(ObjCreate.createGBitmap(ImagesConst.ArenaVS, 135, 27, this));
            this._tfLeftTime = new SecTimerView();
            this._tfLeftTime.setParse(Language.getString(28614));
            this._tfLeftTime.defaultTextFormat = new GTextFormat(FontUtil.songtiName, 18, GlobalStyle.color2Uint, true);
            this._tfLeftTime.filters = [FilterConst.glowFilter];
            this._tfLeftTime.mouseEnabled = false;
            this._tfLeftTime.selectable = false;
            ObjCreate.setObjAttri(this._tfLeftTime, 75, 8, 200, 30, this);
            this._infoTxt = ObjCreate.createGTextField("", 25, 44, 270, 45, this, GlobalStyle.setTextFormatLeading(GlobalStyle._textFormat1, 8));
            this._infoTxt.mouseEnabled = false;
            this._infoTxt.multiline = true;
            this._infoTxt.wordWrap = true;
            this._infoTxt.htmlText = Language.getStringByParam(28615, 0, 0);
            var loc1=ObjCreate.createGButton("", 270, 2, 24, 22, this, "MoveBtn");
            pushUIToDisposeVec(loc1);
            loc1.configEventListener(flash.events.MouseEvent.MOUSE_DOWN, this.onStarMove);
            loc1.configEventListener(flash.events.MouseEvent.MOUSE_UP, this.onStopMove);
            return;
        }

        protected /* override */ disposeImpl(arg1: Boolean=true): void
        {
            this._tfLeftTime.dispose(true);
            this._infoTxt.dispose(true);
            return;
        }

        /* internal */ /* var */_tfLeftTime: SecTimerView;

        /* internal */ /* var */_infoTxt: GTextFiled;
    }
